package com.tyylab.kestrel.framework.core.model.anno.params;

import lombok.Data;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMethod;

@Data
public class MVCMappingParams {
    private String name = "";

    private final String[] path;

    private RequestMethod[] method = new RequestMethod[]{};//RequestMethod.values();

    private String[] params = new String[]{};

    private String[] headers = new String[]{};

    /**
     * @see org.springframework.http.MediaType
     * @see javax.servlet.http.HttpServletRequest#getContentType()
     */
    private String[] consumes = new String[]{};

    /**
     * @see org.springframework.http.MediaType
     */
    private String[] produces = new String[] { MediaType.ALL_VALUE };
    public MVCMappingParams(String[] path) {
        this.path = path;
    }

    public MVCMappingParams(String[] path, RequestMethod... method) {
        this.path = path;
        this.method = method;
    }

    public MVCMappingParams(String name, String[] path, RequestMethod[] method, String[] params, String[] headers,
                      String[] consumes, String[] produces) {
        this.name = name;
        this.path = path;
        this.method = method;
        this.params = params;
        this.headers = headers;
        this.consumes = consumes;
        this.produces = produces;
    }

}
